* December 8, 2020
* terror_muslims_jjps, do-file

set matsize 500
set more off


use "C:\07102020\research, journal papers\Islam\replication materials\data\terror_muslims_jjps.dta", clear

	 
* Appendix 1: Top
corr log_groups fertility449 log_university log_growth497 polity2 log_domestic9 internal interstate
* Appendix 1: Bottom
sum log_groups fertility449 log_university log_growth497 polity2 log_domestic9 internal interstate


tab ccode, gen(cnty)
tab year, gen(yr)
* Table 1
xtreg lead_muspct log_domestic fertility449 log_university log_growth497 polity2 log_domestic9 internal interstate yr*, fe robust
est store Mod1
xtreg lead_muspct log_international fertility449 log_university log_growth497 polity2 log_domestic9 internal interstate yr*, fe robust
est store Mod2
xtreg lead_muspct log_groups fertility449 log_university log_growth497 polity2 log_domestic9 internal interstate yr*, fe robust
est store Mod3
tobit lead_muspct log_domestic fertility449 log_university log_growth497 polity2 log_domestic9 internal interstate cnty* yr*, ll(0) ul(100) robust
est store Mod4
tobit lead_muspct log_international fertility449 log_university log_growth497 polity2 log_domestic9 internal interstate cnty* yr*, ll(0) ul(100) robust
est store Mod5
tobit lead_muspct log_groups fertility449 log_university log_growth497 polity2 log_domestic9 internal interstate cnty* yr*, ll(0) ul(100) robust
est store Mod6
esttab Mod*, b(3) se(3) stats(N ll r2) keep(log_domestic log_international log_groups fertility449 log_university log_growth497 polity2 log_domestic9 internal interstate _cons)
estimates clear


preserve
center lead_muspct log_groups fertility449 log_university log_growth497 polity2 log_domestic9 internal interstate, inplace standardize
tobit lead_muspct log_groups fertility449 log_university log_growth497 polity2 log_domestic9 internal interstate cnty* yr*, ll ul robust
est store Mod6
restore
* Figure 1
coefplot (Mod6, label(Model 6) pstyle(p3) msymbol(O)), drop(_cons cnty* yr*) xline(0) xtitle(Standardized Coefficients) ///
         order(log_groups fertility449 log_university log_growth497 polity2 log_domestic9 internal) ///
         coeflabel(log_groups (standardized) = "Terrorist Organizations" fertility449 (standardized) = "Fertility Rate" ///
		 log_university (standardized) = "College Education" log_growth497 (standardized) = "Economic Growth" polity2 (standardized) = "Democracy" log_domestic9 (standardized) = "Political Instability" internal (standardized) = "Civil War" interstate (standardized) = "Interstate War") ///
         ciopts(recast(rcap))
estimates clear


gen domestic_polity2 = log_domestic * polity2
gen international_polity2 = log_international * polity2
gen groups_polity2 = log_groups * polity2
* Table 2
xtreg lead_muspct log_domestic fertility449 log_university log_growth497 polity2 domestic_polity2 log_domestic9 internal interstate yr*, fe robust
est store Mod1
xtreg lead_muspct log_international fertility449 log_university log_growth497 polity2 international_polity2 log_domestic9 internal interstate yr*, fe robust
est store Mod2
xtreg lead_muspct log_groups fertility449 log_university log_growth497 polity2 groups_polity2 log_domestic9 internal interstate yr*, fe robust
est store Mod3
tobit lead_muspct log_domestic fertility449 log_university log_growth497 polity2 domestic_polity2 log_domestic9 internal interstate cnty* yr*, ll(0) ul(100) robust
est store Mod4
tobit lead_muspct log_international fertility449 log_university log_growth497 polity2 international_polity2 log_domestic9 internal interstate cnty* yr*, ll(0) ul(100) robust
est store Mod5
tobit lead_muspct log_groups fertility449 log_university log_growth497 polity2 groups_polity2 log_domestic9 internal interstate cnty* yr*, ll(0) ul(100) robust
est store Mod6
esttab Mod*, b(3) se(3) stats(N ll r2) keep(log_domestic log_international log_groups fertility449 log_university log_growth497 polity2 domestic_polity2 international_polity2 groups_polity2 log_domestic9 internal interstate _cons)
estimates clear


gen log_muspop = ln(muspop+sqrt(muspop^2+1)) 
* Table 3
tobit D.log_muspop log_domestic fertility449 log_university log_growth497 polity2 log_domestic9 internal interstate cnty* yr*, ll ul robust
est store Mod1
tobit D.log_muspop log_international fertility449 log_university log_growth497 polity2 log_domestic9 internal interstate cnty* yr*, ll ul robust
est store Mod2
tobit D.log_muspop log_groups fertility449 log_university log_growth497 polity2 log_domestic9 internal interstate cnty* yr*, ll ul robust
est store Mod3
esttab Mod*, b(3) se(3) stats(N ll r2) keep(log_domestic log_international log_groups fertility449 log_university log_growth497 polity2 log_domestic9 internal interstate _cons)
estimates clear


* Table 4
tobit lead_muspct log_domestic fertility449 log_university log_growth497 polity2 log_domestic9 internal interstate age00151038 motality836 log_migration915 condom247 urbanization1426 cnty* yr*, ll(0) ul(100) robust
est store Mod1
tobit lead_muspct log_international fertility449 log_university log_growth497 polity2 log_domestic9 internal interstate age00151038 motality836 log_migration915 condom247 urbanization1426 cnty* yr*, ll(0) ul(100) robust
est store Mod2
tobit lead_muspct log_groups fertility449 log_university log_growth497 polity2 log_domestic9 internal interstate age00151038 motality836 log_migration915 condom247 urbanization1426 cnty* yr*, ll(0) ul(100) robust
est store Mod3
esttab Mod*, b(3) se(3) stats(N ll r2) keep(log_domestic log_international log_groups fertility449 log_university log_growth497 polity2 log_domestic9 internal interstate age00151038 motality836 log_migration915 condom247 urbanization1426 _cons)
estimates clear
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 









